import request from '@/utils/request';

// 查询客户列表
export const listConsumer = (query: any) => {
  return request({
    url: '/project/consumer/list',
    method: 'get',
    params: query
  });
}

// 查询客户详细
export const getConsumer = (consumerId: any) => {
  return request({
    url: `/project/consumer/${consumerId}`,
    method: 'get'
  });
}

// 新增客户
export const addConsumer = (data: any) => {
  return request({
    url: '/project/consumer',
    method: 'post',
    data: data
  });
}

// 修改客户
export const updateConsumer = (data: any) => {
  return request({
    url: '/project/consumer',
    method: 'put',
    data: data
  });
}

// 删除客户
export const delConsumer = (consumerId: any) => {
  return request({
    url: `/project/consumer/${consumerId}`,
    method: 'delete'
  });
}
